package fr.matwizz.mesdevoirs.serveur.dao;

import com.googlecode.objectify.Key;
import com.googlecode.objectify.Result;

import fr.matwizz.mesdevoirs.serveur.model.Agenda;

import static com.googlecode.objectify.ObjectifyService.ofy;

/**
 * Created by RGA on 27/04/14.
 */
public class AgendaDAO {
    public static void create(Agenda agenda)
    {
        ofy().save().entity(agenda).now();
    }

    public static Agenda retrieve(Long id)
    {
        Result<Agenda> result = ofy().load().key(Key.create(Agenda.class, id));  // Result is async
        return result.now();
    }

}
